# # import requests
# # from lxml import etree
# # from openpyxl import workbook
# #
# # import re
# #
# #
# # # 中标公告
# # class ZB_Spaders():
# #     def __init__(self):
# #         # 创建excel对象
# #         self.wb = workbook.Workbook()
# #         self.ws = self.wb.active
# #         self.ws.append(
# #             ['标题', '时间', '项目名称', '招标项目编号', '招标范围', '招标机构', '招标人', '开标时间', '公示时间', '评标公示截至时间', '中标人', '制造商', '制造国家或地区',
# #              '所属行业'])
# #         self.url = "https://www.chinabidding.com/search/proj.htm"
# #         self.p = {
# #             'http': 'http://180.120.183.166:4231',
# #             'https': 'https://180.120.183.166:4231'
# #         }
# #         # 'poClass=BidResult&infoClassCodes=0108&pubDate=&rangeType=&normIndustry=&zoneCode=&fundSourceCodes=&fullText=%E5%8D%8E%E8%99%B9%E5%8D%8A%E5%AF%BC%E4%BD%93'
# #         self.payload = {
# #             'poClass': 'BidResult',
# #             'infoClassCodes': '0108',
# #             'pubDate':'',
# #             'rangeType':'',
# #             'normIndustry':'',
# #             'zoneCode':'',
# #             'fundSourceCodes':'',
# #             'fullText': '华虹半导体',
# #         }
# #         self.headers = {
# #             'authority': 'www.chinabidding.com',
# #             'cache-control': 'max-age=0',
# #             'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"',
# #             'sec-ch-ua-mobile': '?0',
# #             'sec-ch-ua-platform': '"Windows"',
# #             'upgrade-insecure-requests': '1',
# #             'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36',
# #             'origin': 'https://www.chinabidding.com',
# #             'content-type': 'application/x-www-form-urlencoded',
# #             'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
# #             'sec-fetch-site': 'same-origin',
# #             'sec-fetch-mode': 'navigate',
# #             'sec-fetch-user': '?1',
# #             'sec-fetch-dest': 'document',
# #             'referer': 'https://www.chinabidding.com/search/proj.htm',
# #             'accept-language': 'zh,zh-CN;q=0.9,en;q=0.8',
# #             'cookie': 'Hm_lvt_3e8bc71035a13d1213b8be00baf17f95=1648012677,1648013354,1648014409,1648100882; __yjs_duid=1_53d9c9faa70c3858764bba9a13836a381648111269893; JSESSIONID=F61C120D756F97241BE0C5080CD82F0A; Hm_lpvt_3e8bc71035a13d1213b8be00baf17f95=1648112126'
# #         }
# #
# #         # response = requests.request("POST", url=self.url, headers=self.headers, data=self.payload)
# #
# #
# #     def get_data_one(self):
# #         all_list = ['华虹半导体', '长江存储', '上海华力', '上海积塔', '合肥晶合', '中芯绍兴', '株洲中车时代']
# #         for name in range(0, len(all_list)):
# #
# #             print(f'----------------------正在下载{all_list[name]}--------------------')
# #             self.payload['fullText'] = all_list[name]
# #             for page in range(1, 5):
# #                 print(f'----------------------正在下载第{page}页--------------------')
# #                 self.payload['currentPage'] = page
# #                 response = requests.post(self.url,headers=self.headers,data=self.payload)
# #                 # response = requests.request("POST", url=self.url, headers=self.headers, data=self.payload)
# #                 # print(response.text)
# #                 if response.status_code == 200:
# #                     # print(response.text)
# #                     html_data = etree.HTML(response.text)
# #                     # print(html_data)
# #                     # 链接
# #                     links = html_data.xpath('//*[@class="as-pager-item"]/@href')
# #                     # print(links)
# #                     # 所属行业
# #                     l_hangye = html_data.xpath('//*[@id="lab-show"]/div[2]/div[2]/div/ul/li/a/div/dl/dd/span[1]/strong/text()')
# #                     # print(l_hangye)
# #                     for link in links:
# #                         # print(link)
# #                         try:
# #                             self.parse_data(link,l_hangye)
# #                         except:
# #                             page+=1
# #                             self.self.payload['currentPage'] = page
# #
# #
# #     def parse_data(self,link, l_hangye):
# #         response = requests.post(link, headers=self.headers, data=self.payload, )
# #         # x = response.text
# #         # print(response.text)
# #         dt = etree.HTML(response.text)
# #
# #         # print(dt)
# #
# #         # 标题
# #         dt_title = dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/h3/text()')
# #         # print(dt_title)
# #         # # 标题
# #         # dt_title = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[2]')).split('发布时间：')[1]
# #         # print(dt_title)
# #         # # 时间
# #         dt_time = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/p/span/text()')).split('发布时间：')[1].split('招标范围：')[1]
# #         # print(dt_time)
# #         # # 项目名称
# #         dt_xiangmumingcheng = dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/h3/text()')
# #         # print(dt_xiangmumingcheng)
# #         # 招标项目编号
# #         dt_xiangmubianhao = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[2]|//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[1]')).split('项目编号：')[1]
# #         # 招标范围
# #         dt_fanwei = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[3]')).split('招标范围：')[1]
# #         # 招标机构
# #         dt_zhaobiaojigou = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[4]')).split('招标机构：')[1]
# #         # 招标人
# #         dt_zhaobiaoren = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[5]')).split('招标人：')[1]
# #         # print(dt_zhaobiaoren)
# #         # 开标时间
# #         dt_kaibiao = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[6]')).split('开标时间：')[1]
# #         # 公示时间
# #         dt_kaishi = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[7]')).split('公示时间：')[1]
# #         # 评标公示截至时间
# #         dt_jiezhi = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[8]')).split('中标结果公告时间：')[1]
# #         # 中标人
# #         dt_zhongbiaoren = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[9]')).split('中标人：')[1]
# #         # 制造商
# #         dt_zhizao = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[10]')).split('制造商：')[1]
# #         # 制造国家或地区
# #         dt_guojiadiqu = ''.join(dt.xpath('//*[@id="lab-show"]/div[2]/div[1]/div/div[2]/text()[11]')).split('制造商国家或地区：')[1]
# #         # 所属行业
# #         dt_hangye = l_hangye
# #         print(l_hangye)
# #         for aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn in zip(dt_title,dt_time,dt_xiangmumingcheng,dt_xiangmubianhao,dt_fanwei,dt_zhaobiaojigou,dt_zhaobiaoren,dt_kaibiao,dt_kaishi,dt_jiezhi,dt_zhongbiaoren,dt_zhizao,dt_guojiadiqu,dt_hangye):
# #             print(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn)
# #             self.save_data(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn)
# #
# #
# #     def save_data(self, aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn):
# #         my_list = [aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn]
# #         self.ws.append(my_list)
# #         self.wb.save(filename="excel__%s招标变更.xlsx" % self.payload['fullText'])
# #
# # if __name__ == '__main__':
# #
# #
# #     # a = Bidding_Spiders()
# #     # a.parse_main_page()
# #     # b = Change_Spiders()
# #     # b.get_data_one(url)
# #     # c = TB_Spiders()
# #     # c.get_data_one(url)
# #     d = ZB_Spaders()
# #     d.get_data_one()
# #
# #
#
# #
# # a = "dhnakdjalsdaowdad"
# # c= a.split('j')[1]
# # print(c)
# # import tkinter as tk
# #
# # window = tk.Tk()
# # window.title('666')
# # window.geometry('700x400')
# # var = tk.StringVar()
# # l = tk.Label(window, textvariable=var, bg='green', fg='white', font=('Arial',12),width=30,height=2)
# # l.pack()
# # on_hit = False
# # def hit_me():
# #     global on_hit
# #     if on_hit == False:
# #         on_hit = True
# #         var.set("666")
# #     else:
# #         on_hit = False
# #         var.set('')
# # b = tk.Button(window, text='hit me',  font=('Arial',12),width=10,height=1,command=hit_me)
# # b.pack()
# # window.mainloop()
# #
# # import tkinter as tk
# #
# # root = tk.Tk()
# # root.title("how to do ")
# # root.geometry('500x300')
# # tk.Label(root, text="显示", bg="green", font=("Arial", 12), width=5, height=1).place(x=20, y=30)
# #
# #
# # def printtext():
# #     EditText.insert(1.0, A())
# #
# #
# # def A():
# #     if 2 > 3:
# #         return "句子1"
# #     elif 2 < 0:
# #         return "句子2"
# #     else:
# #         return "句子3"
# #
# #
# # EditText = tk.Text(root, width=20, height=10)
# # EditText.grid(row=2, column=3)
# # btn_test = tk.Button(root, text="按钮", command=printtext, width=7, height=2)
# #
# # btn_test.place(x=200, y=60)
# #
# # root.mainloop()
#
#
# #
# #
# #
# # from tkinter import *
# #
# # yourData = "My text here"
# #
# # root = Tk()
# # frame = Frame(root, width=100, height=100)
# # frame.pack()
# #
# # lab = Label(frame,text=yourData)
# # lab.pack()
# #
# # root.mainloop()
#
#
# import tkinter as tk
#
#
# class Window:
#     def __init__(self, handle):
#         self.win = handle
#         self.createwindow()
#         self.run()
#
#     def createwindow(self):
#         self.win.geometry('400x400')
#         # label 1
#         self.label_text = tk.StringVar()
#         self.label_text.set("----")
#         self.lable = tk.Label(self.win,
#                               textvariable=self.label_text,
#                               font=('Arial', 11), width=15, height=2)
#         self.lable.pack()
#
#         # text_contrl
#         self.entry_text = tk.StringVar()
#         self.entry = tk.Entry(self.win, textvariable=self.entry_text, width=30)
#         self.entry.pack()
#
#         # button
#         self.button = tk.Button(self.win, text="set label to text", width=15, height=2, command=self.setlabel)
#         self.button.pack()
#
#     def setlabel(self):
#         print(self.entry_text.get())
#         self.label_text.set(self.entry_text.get())
#
#     def run(self):
#         try:
#             self.win.mainloop()
#         except Exception as e:
#             print("*** exception:\n".format(e))
#
#
# def main():
#     window = tk.Tk()
#     window.title('hello tkinter')
#     Window(window).run()
#
#
# if __name__ == "__main__":
#     main()
# import tkinter as tk
#
# root = tk.Tk()
# root.title("how to do ")
# root.geometry('500x300')
# tk.Label(root, text="显示", bg="green", font=("Arial", 12), width=5, height=1).place(x=20, y=30)
#
#
# def printtext():
#     EditText.insert('1.0', A())
#
#
# def A():
#     if 2 > 3:
#         print("句子1")
#     elif 2 < 0:
#         print("句子2")
#     else:
#         print("句子3")
# EditText = tk.Text(root, width=20, height=10)
# EditText.grid(row=2, column=3)
# btn_test = tk.Button(root, text="按钮", command=printtext, width=5, height=2)
# btn_test.place(x=200, y=60)
# root.mainloop()
#


# !/usr/bin/env python
# -*- coding:utf-8 -*-
import tkinter

win = tkinter.Tk()
win.title("yudanqu")
win.geometry("400x400+200+50")


def updata():
    message = ""    
    if hobby1.get() == True:
        message += "moneyn"
    if hobby2.get() == True:
        message += "powern"
    if hobby3.get() == True:
        message += "peoplen"

    # 清空text中所有内容
    text.delete(0.0, tkinter.END)
    text.insert(tkinter.INSERT, message)


# 要绑定的变量
hobby1 = tkinter.BooleanVar()
# 多选框
check1 = tkinter.Checkbutton(win, text="money", variable=hobby1, command=updata)
check1.pack()
hobby2 = tkinter.BooleanVar()
check2 = tkinter.Checkbutton(win, text="power", variable=hobby2, command=updata)
check2.pack()
hobby3 = tkinter.BooleanVar()
check3 = tkinter.Checkbutton(win, text="people", variable=hobby3, command=updata)
check3.pack()

text = tkinter.Text(win, width=50, height=5)
text.pack()

win.mainloop()
